package com.yjy.es.document;


import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;


@Data
@Document(indexName = "#{@environment.getProperty('es.article.indexName')}", shards = 1, replicas = 1)
public class Article {

    @Id
    private Long id; // 主键

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String title; // 标题

    @Field(type = FieldType.Keyword)
    private String category;// 分类

    @Field(type = FieldType.Double)
    private Double price; // 价格

    @Field(index = false, type = FieldType.Keyword)
    private String images; // 图片地址

    private Date createDate;
}
